#pragma once


#include <mathlib/intype.h>


BEGIN_NAMESPACE_OXGE


class GRAPHIC_TRANSFER ColorRGBA
{
public:
	typedef float ValueType;
	typedef ColorRGBA ColorType;
	
	static const ColorType Black;
	static const ColorType White;
	static const ColorType Red;
	static const ColorType Green;
	static const ColorType Blue;

	ColorRGBA(){}
	explicit ColorRGBA( ValueType red, ValueType green, ValueType blue, ValueType alpha = ValueType(1) ) : r(red), g(green), b(blue), a(alpha)
	{ }
	
	ColorType& SetRGBA(ValueType red, ValueType green, ValueType blue, ValueType alpha = ValueType(1) ){
		r = red; g = green; b = blue; a = alpha; 
		return *this;
	}

	bool operator==(const ColorType& rhs) const;
	bool operator!=(const ColorType& rhs) const;

	inline operator ValueType*() { return c_v; }	
	inline operator const ValueType*()const { return c_v; }

	
protected:
	const static size_t NLen = 4;
	union{
		struct{
			ValueType r,g,b,a;
		};
		ValueType c_v[NLen];
	};

};

END_NAMESPACE_OXGE